3e38a10cf6979b75481a07dc1a9e8b62f9904ee0,ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java,History,findHistoryByJobAndStatus,#EntityManager#JPAEntity#BigInteger#JobStatus#,192

Before Change



        TypedQuery<History> query = em.createNamedQuery("History.findByJobAndStatus", History.class);

        if (limit != null) {
            query.setMaxResults(limit.intValue());
        }
        try {
            query.setParameter("entity", job);

After Change


    public static List<History> findHistoryByJobAndStatus(EntityManager em, BigInteger jobId, int limit, JobStatus jobStatus) {
        requireArgument(em != null, "Entity manager cannot be null.");
        requireArgument(jobId != null, "The jobId cannot be null.");
        requireArgument(limit > 0, "Limit must be a positive integer.");

        TypedQuery<History> query = em.createNamedQuery("History.findByJobAndStatus", History.class);
        query.setMaxResults(limit);
        
        try {
            query.setParameter("entityId", jobId);